#include "CameraManager.h"
#include "StaticCamera.h"

CameraManager::CameraManager()
{
	m_pCurrentCamera = NULL;
}

CameraManager::~CameraManager()
{
}

void CameraManager::Initialize()
{
	StaticCamera* staticCamera = new StaticCamera();

	Add(staticCamera);
	SetCurrentCamera(staticCamera);
}

void CameraManager::Update(float elapsedTime)
{
	if(m_pCurrentCamera)
	{
		m_pCurrentCamera->Update(elapsedTime);
	}
}

void CameraManager::Add(Camera* camera)
{
	m_pCameras.push_back(camera);
}

std::list<Camera*> CameraManager::GetCameras()
{
	return m_pCameras;
}

Camera* CameraManager::GetCurrentCamera()
{
	return m_pCurrentCamera;
}

void CameraManager::SetCurrentCamera(Camera* camera)
{
	m_pCurrentCamera = camera;
}

CameraManager* CameraManager::GetInstance()
{
	if(!m_pInstance)
	{
		m_pInstance = new CameraManager();
	}

	return m_pInstance;
}

CameraManager* CameraManager::m_pInstance = NULL;